package youke.home.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import youke.home.services.QuKLiveService;
import youke.home.services.QuKLivetsService;
import youke.home.services.TestAliveServices;
import java.io.IOException;

@RestController
@RequestMapping("/live")
public class LiveInfoController {

    @Autowired
    private QuKLiveService quKLiveService;

    @Autowired
    private QuKLivetsService quKLivetsService;

    @Autowired
    private TestAliveServices testAliveServices;

    // 获取直播信息
    @GetMapping("/getInfo")
    public Object getLiveInfo(@RequestParam("liveId") Long liveId) {
        // 调用 QuKLiveService 的 getLiveInfo 方法，获取直播信息
        return quKLiveService.getLiveInfo(liveId);
    }
    @GetMapping("/getinfo1")
    public Object getinfo1(@RequestParam("liveId") Long liveId) {
        // 调用 QuKLiveService 的 getLiveInfo 方法，获取直播信息
        return quKLivetsService.getLiveInfo(liveId);
    }
    @GetMapping("/getALIVE")
    public Object getALIVE(@RequestParam("liveId") Long liveId) {
        // 调用 QuKLiveService 的 getLiveInfo 方法，获取直播信息
        try {
            return testAliveServices.getJsonNode(liveId);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}

